home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / BOOPSI / GI1 / Install < prev   
Encoding:
Text File  |  1994-03-12  |  7.8 KB  |  328 lines

  1. ;******************************************************************************
  2. ; Installation script for Gadget & Image Collection #1 (GI1)
  3. ; Written by David N. Junod
  4. ;******************************************************************************
  5.  
  6. ; Initialize a few things
  7. (set docbits 0)
  8. (set ename "GI1_Examples")
  9.  
  10. ;******************************************************************************
  11. ; Ask the user if we are installing or removing
  12.  
  13. (set mode
  14.     (askchoice
  15.         (prompt "Gadget & Image Collection #1")
  16.         (help @askchoice-help)
  17.         (choices "Install" "Remove")
  18.     )
  19. )
  20.  
  21. ; Set the prompt string
  22. (if mode
  23.     (set pmode "Remove")
  24.     (set pmode "Install")
  25. )
  26.  
  27. ;******************************************************************************
  28. ; Prompt for components and their directories
  29.  
  30. (set cbits
  31.     (askoptions
  32.         (prompt "Components to " pmode)
  33.         (help @askoptions-help)
  34.         (choices "Classes" "Examples" "Example source" "Include files" "Autodocs")
  35.         (default 1)
  36.     )
  37. )
  38.  
  39. ; Classes
  40. (if (bitand cbits 1)
  41.     (set classdir
  42.         (askdir
  43.             (prompt "Where do the Classes belong")
  44.             (help @askdir-help)
  45.             (default "SYS:Classes")
  46.         )
  47.     )
  48. )
  49.  
  50. ; Developer files
  51. (if (bitand cbits 6)
  52.     (set edir
  53.         (askdir
  54.             (prompt "Where does the " ename " directory belong")
  55.             (help @askdir-help)
  56.             (default "WORK:")
  57.         )
  58.     )
  59. )
  60.  
  61. ; Include files
  62. (if (bitand cbits 8)
  63.     (set incdir
  64.         (askdir
  65.             (prompt "Where do the Include files belong")
  66.             (help @askdir-help)
  67.             (default "INCLUDE:")
  68.         )
  69.     )
  70. )
  71.  
  72. ; Autodocs files
  73. (if (bitand cbits 16)
  74.     (
  75.         (set docbits
  76.             (askoptions
  77.                 (prompt "Autodocs formats to " pmode)
  78.                 (help @askoptions-help)
  79.                 (choices "Text" "AmigaGuide")
  80.                 (default 3)
  81.             )
  82.         )
  83.         (if (bitand docbits 1)
  84.             (set tdocdir
  85.                 (askdir
  86.                     (prompt "Where do the text-format Autodoc files belong")
  87.                     (help @askdir-help)
  88.                     (default "DOC:")
  89.                 )
  90.             )
  91.         )
  92.         (if (bitand docbits 2)
  93.             (set adocdir
  94.                 (askdir
  95.                     (prompt "Where do the AmigaGuide-format Autodoc files belong")
  96.                     (help @askdir-help)
  97.                     (default (getenv "amigaguide/path"))
  98.                 )
  99.             )
  100.         )
  101.     )
  102. )
  103.  
  104. ;******************************************************************************
  105. ;******************************************************************************
  106. ;******************************************************************************
  107.  
  108. (if mode
  109.         ;**********************************************************************
  110.     ; Remove
  111.         ;**********************************************************************
  112.     (
  113.         ; Are we supposed to remove classes
  114.         (if (bitand cbits 1)
  115.             (
  116.                 (working "Removing Classes")
  117.                 (delete (tackon classdir "gadgets/button.gadget"))
  118.                 (delete (tackon classdir "gadgets/calendar.gadget"))
  119.                 (delete (tackon classdir "gadgets/tabs.gadget"))
  120.                 (delete (tackon classdir "images/led.image"))
  121.             )
  122.         )
  123.  
  124.         ; Are we supposed to remove examples
  125.         (if (bitand cbits 2)
  126.             (
  127.                 (working "Removing Examples")
  128.                 (delete (tackon edir "GI1_Examples/Button_Test") (infos))
  129.                 (delete (tackon edir "GI1_Examples/Calendar_Test") (infos))
  130.                 (delete (tackon edir "GI1_Examples/Tabs_Test") (infos))
  131.                 (delete (tackon edir "GI1_Examples/LED_Test") (infos))
  132.             )
  133.         )
  134.  
  135.         ; Are we supposed to remove example source files
  136.         (if (bitand cbits 4)
  137.             (
  138.                 (working "Removing Example Source")
  139.                 (delete (tackon edir "GI1_Examples/Button_Test.c") (infos))
  140.                 (delete (tackon edir "GI1_Examples/Calendar_Test.c") (infos))
  141.                 (delete (tackon edir "GI1_Examples/Tabs_Test.c") (infos))
  142.                 (delete (tackon edir "GI1_Examples/LED_Test.c") (infos))
  143.             )
  144.         )
  145.  
  146.         (if (bitand cbits 6)
  147.             (
  148.                 (delete (tackon edir ename) (infos))
  149.             )
  150.         )
  151.  
  152.         ; Are we supposed to remove include files
  153.         (if (bitand cbits 8)
  154.             (
  155.                 (working "Removing Include files")
  156.                 (delete (tackon incdir "gadgets/button.h"))
  157.                 (delete (tackon incdir "gadgets/calendar.h"))
  158.                 (delete (tackon incdir "gadgets/tabs.h"))
  159.                 (delete (tackon incdir "images/led.h"))
  160.                 (delete (tackon incdir "gadgets/button.i"))
  161.                 (delete (tackon incdir "gadgets/calendar.i"))
  162.                 (delete (tackon incdir "gadgets/tabs.i"))
  163.                 (delete (tackon incdir "images/led.i"))
  164.             )
  165.         )
  166.  
  167.         ; Are we supposed to remove text autodoc files
  168.         (if (bitand docbits 1)
  169.             (
  170.                 (working "Removing text-format Autodocs")
  171.                 (delete (tackon tdocdir "button_gc.doc") (infos))
  172.                 (delete (tackon tdocdir "calendar_gc.doc") (infos))
  173.                 (delete (tackon tdocdir "tabs_gc.doc") (infos))
  174.                 (delete (tackon tdocdir "led_ic.doc") (infos))
  175.             )
  176.         )
  177.  
  178.         ; Are we supposed to remove AmigaGuide autodoc files
  179.         (if (bitand docbits 2)
  180.             (
  181.                 (working "Removing AmigaGuide-format Autodocs")
  182.                 (delete (tackon adocdir "button_gc") (infos))
  183.                 (delete (tackon adocdir "calendar_gc") (infos))
  184.                 (delete (tackon adocdir "tabs_gc") (infos))
  185.                 (delete (tackon adocdir "led_ic") (infos))
  186.             )
  187.         )
  188.  
  189.         ; Don't want to use the confusing "Installation Complete" message
  190.         ; when what we really did was remove things...
  191.         (message "The \"Gadget & Image Collection #1\" components "
  192.              "that you specified have been successfully removed")
  193.         (exit (quiet))
  194.     )
  195.  
  196.         ;**********************************************************************
  197.     ; Install
  198.         ;**********************************************************************
  199.     (
  200.         ; Are we supposed to install classes
  201.         (if (bitand cbits 1)
  202.             (
  203.                 ; Make sure the class sub-directories exist */
  204.                 (makedir (tackon classdir "Gadgets"))
  205.                 (makedir (tackon classdir "Images"))
  206.  
  207.                 ; Install the classes
  208.                 (copylib
  209.                     (prompt "Copying button gadget")
  210.                     (help @copylib-help)
  211.                     (source "classes/gadgets/button.gadget")
  212.                     (dest (tackon classdir "Gadgets"))
  213.                     (confirm)
  214.                 )
  215.                 (copylib
  216.                     (prompt "Copying calendar gadget")
  217.                     (help @copylib-help)
  218.                     (source "classes/gadgets/calendar.gadget")
  219.                     (dest (tackon classdir "Gadgets"))
  220.                     (confirm)
  221.                 )
  222.                 (copylib
  223.                     (prompt "Copying tabs gadget")
  224.                     (help @copylib-help)
  225.                     (source "classes/gadgets/tabs.gadget")
  226.                     (dest (tackon classdir "Gadgets"))
  227.                     (confirm)
  228.                 )
  229.                 (copylib
  230.                     (prompt "Copying LED image")
  231.                     (help @copylib-help)
  232.                     (source "classes/images/led.image")
  233.                     (dest (tackon classdir "Images"))
  234.                     (confirm)
  235.                 )
  236.             )
  237.         )
  238.  
  239.         ; Are we supposed to install Example files
  240.         (if (bitand cbits 2)
  241.             (
  242.                 (makedir (tackon edir ename) (infos))
  243.                 (copyfiles
  244.                     (prompt "Copying Examples")
  245.                     (help @copyfiles-help)
  246.                     (source "Examples")
  247.                     (dest (tackon edir ename))
  248.                     (pattern "~(#?.(c|c.info))")
  249.                     (confirm)
  250.                 )
  251.             )
  252.         )
  253.  
  254.         ; Are we supposed to install Example source files
  255.         (if (bitand cbits 4)
  256.             (
  257.                 (makedir (tackon edir ename) (infos))
  258.                 (copyfiles
  259.                     (prompt "Copying Example source")
  260.                     (help @copyfiles-help)
  261.                     (source "Examples")
  262.                     (dest (tackon edir ename))
  263.                     (pattern "#?.(c|c.info)")
  264.                     (confirm)
  265.                 )
  266.             )
  267.         )
  268.  
  269.         ; Are we supposed to install Include files
  270.         (if (bitand cbits 8)
  271.             (
  272.                 (copyfiles
  273.                     (prompt "Copying gadget headers")
  274.                     (help @copyfiles-help)
  275.                     (source "include/gadgets")
  276.                     (dest (tackon incdir "gadgets"))
  277.                     (pattern "~(#?.info)")
  278.                     (confirm)
  279.                 )
  280.                 (copyfiles
  281.                     (prompt "Copying image headers")
  282.                     (help @copyfiles-help)
  283.                     (source "include/images")
  284.                     (dest (tackon incdir "images"))
  285.                     (pattern "~(#?.info)")
  286.                     (confirm)
  287.                 )
  288.                 (copyfiles
  289.                     (prompt "Copying Intuition headers")
  290.                     (help @copyfiles-help)
  291.                     (source "include/intuition")
  292.                     (dest (tackon incdir "intuition"))
  293.                     (pattern "~(#?.info)")
  294.                     (confirm)
  295.                 )
  296.             )
  297.         )
  298.  
  299.         ; Are we supposed to install text autodoc files
  300.         (if (bitand docbits 1)
  301.             (
  302.                 (copyfiles
  303.                     (prompt "Copying text-format Autodocs")
  304.                     (help @copyfiles-help)
  305.                     (source "Doc")
  306.                     (dest tdocdir)
  307.                     (all)
  308.                     (confirm)
  309.                 )
  310.             )
  311.         )
  312.  
  313.         ; Are we supposed to install AmigaGuide autodoc files
  314.         (if (bitand docbits 2)
  315.             (
  316.                 (copyfiles
  317.                     (prompt "Copying AmigaGuide-format Autodocs")
  318.                     (help @copyfiles-help)
  319.                     (source "AGDoc")
  320.                     (dest adocdir)
  321.                     (all)
  322.                     (confirm)
  323.                 )
  324.             )
  325.         )
  326.     )
  327. )
  328.